package com.ruoyi.report.service.impl.processor;

import com.ruoyi.common.enums.DataType;
import com.ruoyi.report.service.ReportProcessor;

public class ReportProcessorFactory {
	public static <T> ReportProcessor<T> getProcessor(String reportType) {
		if (DataType.ITEM.getName().equals(reportType)) {
			return (ReportProcessor<T>) new ItemReportProcessor(); // 返回具体的处理器
		} else if (DataType.INVENTORY.getName().equals(reportType)) {
			return (ReportProcessor<T>) new InventoryReportProcessor();
		} else if (DataType.SHIPPING_CONFIGURATION.getName().equals(reportType)) {
			return (ReportProcessor<T>) new ShippingConfigurationReportProcessor();
		} else if (DataType.SHIPPING_PROGRAM.getName().equals(reportType)) {
            return (ReportProcessor<T>) new ShippingProgramReportProcessor();
        } else if (DataType.RETURN_OVERRIDES.getName().equals(reportType)) {
			return (ReportProcessor<T>) new ReturnOverridesReportProcessor();
		} else if (DataType.PROMO.getName().equals(reportType)) {
			return (ReportProcessor<T>) new PromotionsReportProcessor();
		} else if (DataType.FITMENT_MISSING_ATTR.getName().equals(reportType)) {
			return (ReportProcessor<T>) new FitmentMissingAttrReportProcessor();
		} else if (DataType.FITMENT_ACES_COVERAGE.getName().equals(reportType)) {
			return (ReportProcessor<T>) new FitmentAcesCoverageReportProcessor();
		} else if (DataType.BUYBOX.getName().equals(reportType)) {
			return (ReportProcessor<T>) new BuyBoxReportProcessor();
		} else if (DataType.LAGTIME.getName().equals(reportType)) {
			return (ReportProcessor<T>) new LagTimeReportProcessor();
		} else if (DataType.CANCELLATION.getName().equals(reportType)) {
			return (ReportProcessor<T>) new CancellationReportProcessor();
		} else if (DataType.ASSORTMENT_RECOMMENDATIONS.getName().equals(reportType)) {
			return (ReportProcessor<T>) new AssortmentRecommendationsReportProcessor();
		} else if (DataType.CPA.getName().equals(reportType)) {
			return (ReportProcessor<T>) new CpaReportProcessor();
		} else if (DataType.DELIVERY_DEFECT.getName().equals(reportType)) {
			return (ReportProcessor<T>) new DeliveryDefectReportProcessor();
		} else if (DataType.ITEM_PERFORMANCE.getName().equals(reportType)) {
			return (ReportProcessor<T>) new ItemPerformanceReportProcessor();
		}
		// 根据报表类型可以继续扩展不同的处理器
		return null;
	}
}
